﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.OleDb;
using System.Data;

namespace DAO
{
    public class AbstractDAO
    {
        private string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=NhaSach.mdb";

        public OleDbConnection Open()
        {
            OleDbConnection connection = new OleDbConnection(connectionString);
            connection.Open();
            return connection;
        }

        public void Close(OleDbConnection connection)
        {
            if (connection != null && connection.State == ConnectionState.Open)
            {
                connection.Close();
            }
        }
    }
}
